#ifndef DEVICE_H
#define DEVICE_H

#include "../msg/msg.h"
#include "../../project/nav_view.h"

#include <termios.h>
#include <unistd.h>

#include <view.h>
#include <config.h>
#include <types.h>
using namespace std;
class device{
public:
	static int left;
	static int top;
	static int width;
	static int right;
	static int bottom;
	static int fd;
	static int zk;
	static nav_view nav;

	#ifdef COLOR32
	static unsigned int *bitbuf;
	#else
	static unsigned short *bitbuf;
	#endif
	#ifdef LINUX_CONSOLE
	static struct termios old;
	static int init_console();
	static int exit_console();
	#endif
        static unsigned char *buf_zk;
        static int zk_len;

	device();
	~device();

	static int init();
	static int exit();
	static int message(msg *m);
	#ifdef COLOR32
	static void draw_string(char *tt,int x,int y,unsigned int color);
	static void draw_line(int l,int t,int len,enum LINE_TYPE type,unsigned int color);
	static void draw_rect(int l,int t,int r,int b,unsigned int color);
	static void fill_rect(int l,int t,int r,int b,unsigned int color);
	#else
	static void draw_string(char *tt,int x,int y,unsigned short color);
	static void draw_line(int l,int t,int len,enum LINE_TYPE type,unsigned short color);
	static void draw_rect(int l,int t,int r,int b,unsigned short color);
	static void fill_rect(int l,int t,int r,int b,unsigned short color);
	#endif

	static int draw_jpg(int l,int t,char *filename);

	
};
#endif
